﻿using DocumentFormat.OpenXml.Lite.Helper;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.WordprocessingML.Word.RunProperties
{
    [XmlRoot("lang", Namespace = Constants.WordMain)]
    public class Languages : XmlSerializable, IRunPropElement
    {
        [Optional]
        [XmlAttribute("val", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public string Value { get; set; }

        [Optional]
        [XmlAttribute("eastAsia", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public string EastAsia { get; set; }

        [Optional]
        [XmlAttribute("bidi", Namespace = Constants.WordMain, Form = XmlSchemaForm.Qualified)]
        public string ComplexLanguage { get; set; }

        public Languages() { }

        public void Copy(object obj)
        {
            if (obj is Languages)
            {
                this.Value = (obj as Languages).Value;
                this.EastAsia = (obj as Languages).EastAsia;
                this.ComplexLanguage = (obj as Languages).ComplexLanguage;
            }
        }
    }
}
